﻿@model IEnumerable<HotelManageSystem.Models.FloorInfoModel>

@{
    ViewBag.Title = "ShowAllFloor";
    Layout = "~/Views/Shared/_Template2.cshtml";
}
@section Head{
    <link href="../../Content/TelerikGrid.css" rel="stylesheet" type="text/css" />
}
@{
    Html.Telerik().Grid(Model)
        .Name("Grid")
        .DataKeys(key => key.Add(r => r.ID))
        .ToolBar(command => command.Insert())
        .DataBinding(dataBind => dataBind.Ajax()
                                     .OperationMode(GridOperationMode.Client)
                                     .Select("TelerikAjax", "Floor")
                                     .Update("UpdateFloor", "Floor")
                                     .Delete("DeleteFloor", "Floor")
                                     .Insert("AddFloor", "Floor")
        )

        .Pageable(page => page
                              .Style(GridPagerStyles.NextPreviousAndNumeric)
                              .Position(GridPagerPosition.Bottom)
                              .PageSize(6))
        .Columns(columns =>
                     {
                         columns.Bound(r => r.ID).Title("ID").Width(20).HtmlAttributes(new {style = "text-align: center"});
                         columns.Bound(r => r.Name).Title("楼层名称").Width(300).HtmlAttributes(new {style = "text-align:center"});
                         columns.Bound(r => r.Remark).Title("备注").Width(300).HtmlAttributes(new { style = "text-align:center" });
                         columns.Command(commands =>
                                             {
                                                 commands.Edit().ButtonType(GridButtonType.ImageAndText); 
                                                 commands.Delete().ButtonType(GridButtonType.ImageAndText);
                                             }).Width(180).Title("操作");
                     }
                )
     .Editable(e=>e.Mode(GridEditMode.PopUp))
     .Selectable()
     .Sortable()
     .Filterable()
     .Render();
    
   
}

